
# .gdbinit
# Andrew Davison, ad@fivedots.coe.psu.ac.th, Feb 2020

# python extensions --------------------------

python import duel
# from https://github.com/vuvova/gdb-tools


# gdb globals vars ------------------------

set $LOGIT = 0     
# used to toggle logging to a file

# hooks ---------------------------------------

define hook-quit
  set confirm off
end

define hook-stop
  refresh
end

define hook-next
  refresh
end

# gdb commands -------------------------

define w
  where
  info locals
  info args
end


define bs
  info breakpoints
end


define h
  show commands
end


define log
  if $LOGIT == 0
    set logging file $arg0 
    set logging on
    echo Logging to $arg0 \n
    set $LOGIT = 1
  else
    set logging off
    echo Logging finished \n
    set $LOGIT = 0
  end
end


# window settings ---------------------------

# set tui border-kind space
winheight src 20

# configuration settings --------------------

set history filename ~/.gdb_history
set history save on
set history expansion on
set history size 100
set history remove-duplicates unlimited

set logging overwrite on

set print pretty on
set print array on
set print array-indexes on

